package com.zlcdgroup.android.leaflet

import android.os.Bundle
import android.view.ViewGroup
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity

/**
 *
 * @author: aking <a href="mailto:akingyin@163.com">Contact me.</a>
 * @since: 2025/7/14 10:33
 * @version: 1.0
 */
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val mapView = MapView(this)
        mapView.layoutParams = ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT
        )
        mapView.setMapListener(object : MapListener {
            override fun onMapLoaded() {
               mapView.postDelayed({
                    mapView.setMapCenter(29.56221,106.567061)
                    mapView.addMarker(29.56221,106.567061,"test.png",0,"123")
                },1000)
            }

            override fun onMapMarkerClick(lat: Double, lng: Double, uuid: String?) {
                Toast.makeText(this@MainActivity,"点击了标记：$uuid",Toast.LENGTH_SHORT).show()
            }
        })

        setContentView(mapView)

    }
}